﻿using System;
using System.Collections.Generic;
using ConfOrm;
using ConfOrm.NH;

namespace NHDay_Linq.ConfORM
{
	public static class DomainMapperHelper
	{
		public static IEnumerable<Type> ApplyMappings<T>(ObjectRelationalMapper orm, Mapper mapper)
			where T : IDomainMapping, new()
		{
			IDomainMapping domainMapping = new T();
			domainMapping.DomainDefinition(orm);
			domainMapping.RegisterPatterns(mapper, orm);
			domainMapping.Customize(mapper);
			return domainMapping.GetEntities();
		}
	}
}